package com.example.rxjavademo.adapter;

import android.graphics.BitmapFactory;
import android.net.Uri;
import android.provider.MediaStore;
import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.blankj.utilcode.util.UriUtils;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.rxjavademo.MainActivity;
import com.example.rxjavademo.R;
import com.example.rxjavademo.model.Mtv;

import java.io.IOException;

public class MyDataViewAdapter extends BaseQuickAdapter<Mtv, BaseViewHolder> {



    public MyDataViewAdapter() {
        super(R.layout.list_mtv_data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, Mtv item) {
        helper.setText(R.id.tv_num, String.valueOf(helper.getAdapterPosition()+1));
        helper.setText(R.id.tv_id, "id:"+item.getId());
        helper.setText(R.id.tv_title, "title:"+item.getTitle());
        helper.setText(R.id.tv_rate, "rate:"+item.getRate());
        helper.setText(R.id.tv_url, "url:"+item.getUrl());
        helper.setText(R.id.tv_isnew, "isnew:"+item.isIs_new());
        Glide.with(this.mContext).load(item.getCover()).into((ImageView) helper.getView(R.id.iv_cover));
    }

}
